package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.KindItem;
import cn.wolfcode.crm.mapper.KindItemMapper;
import cn.wolfcode.crm.query.KindQueryObject;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.service.IKindItemService;
import cn.wolfcode.crm.util.PageResult;
import cn.wolfcode.crm.util.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KindItemServiceImpl implements IKindItemService{
    @Autowired
    private KindItemMapper mapper;
    public void save(KindItem entity) {
        mapper.insert(entity);
    }

    public void update(KindItem entity) {
        mapper.updateByPrimaryKey(entity);
    }

    public void delete(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public List<KindItem> list() {


        return mapper.selectAll();
    }

    public KindItem get(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

	public PageResult query(QueryObject qo) {
		return PageUtils.query(qo, mapper);
	}

    public Integer queryForMoney() {
        return  mapper.queryForMoney();
    }

    public List<KindItem>  listView(KindQueryObject qo) {
        return mapper.listView(qo);
    }

}
